package com.amigo.online.common.param.result;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class UserInfo implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6679340725796183204L;
	@NotNull
	@Min(1)
	private Long id;
	
	private String account;
	
	private Integer accountDefault;
	
	private String mobilephone;

	private Integer type;

	private String nickname;
	
	private String sex;
	
	private String email;
	
	private Integer country;
	
	private Integer province;
	
	private Integer city;
	
	private String company;
	
	private String job;
	
	private String school;
	
	private Long birthday;
	
	private Integer love;
	
	private String sign;
	
	private Integer vip;

	private Boolean honoured;//VIP

	private Date vipEndTime;
	
	private Integer verified;
	
	private Long verifiedTime;
	
	private Integer celebrity;
	
	private String avatar;
	
	private String background;
	
	private Integer homeCountry;
	
	private Integer homeProvince;
	
	private Integer homeCity;
	
	private String device;
	
	private String home;
	
	private String countryCode;
	//隐私设置
	private Integer secret;
	//facebookID
	private String facebookOpenId;
	//点赞通知
	private Integer notifyZan;
	//评论通知
	private Integer notifyComment;
	//关注通知
	private Integer notifyFollow;
	//群组通知
	private Integer notifyGroup;
	//声音通知
	private Integer notifyVoice;

	private List<PhotoInfo> photos = new ArrayList<>();
    //两者间距离
	private Double distance = -1D;
	
	private String dis;
	//最后登录时间
	private long lastLoginTime;
	// 性別是否已經修改過
	private Integer sexModified;
	//
	private List<HobbyInfo> hobbylist = new ArrayList<>();
	//是否开启探探功能
	private Integer openT;
	//用户小头像
	private String avatarSmall;
	//商家id   如果是 0 则不是   
	private Long merchantId = 0l;
	
	private Long createTime;
	

	public void addPhoto(PhotoInfo photo) {
		if(this.photos == null) {
			this.photos = new ArrayList<PhotoInfo>();
		}
		this.photos.add(photo);
	}

	
	public void removePhoto(Long id) {
		for(int i= photos.size()-1; i>= 0; i--) {
			PhotoInfo p = photos.get(i);
			if(p.getId().equals(id)) {
				photos.remove(i);
				break;
			}
		}
	}
	

	public UserInfo(Long id, String account, Integer accountDefault, String mobilephone,
			String nickname, String sex, String email, Integer country, Integer province, Integer city, String company,
			String job, String school, Long birthday, Integer love, String sign, Integer vip, Integer verified,
			Long verifiedTime, Integer celebrity, String avatar, String background, Integer homeCountry,
			Integer homeProvince, Integer homeCity, String device, Integer secret, String facebookOpenId,
			Integer notifyZan, Integer notifyComment, Integer notifyFollow, Integer notifyGroup, Integer notifyVoice,
			String home, String avatarSmall) {

		super();
		this.id = id;
		this.account = account;
		this.accountDefault = accountDefault;
		this.mobilephone = mobilephone;
		this.nickname = nickname;
		this.sex = sex;
		this.email = email;
		this.country = country;
		this.province = province;
		this.city = city;
		this.company = company;
		this.job = job;
		this.school = school;
		this.birthday = birthday;
		this.love = love;
		this.sign = sign;
		this.vip = vip;
		this.verified = verified;
		this.verifiedTime = verifiedTime;
		this.celebrity = celebrity;
		this.avatar = avatar;
		this.background = background;
		this.homeCountry = homeCountry;
		this.homeProvince = homeProvince;
		this.homeCity = homeCity;
		this.device = device;
		this.secret = secret;
		this.facebookOpenId = facebookOpenId;
		this.notifyZan = notifyZan;
		this.notifyComment = notifyComment;
		this.notifyFollow = notifyFollow;
		this.notifyGroup = notifyGroup;
		this.notifyVoice = notifyVoice;
		this.home = home;
		this.avatarSmall = avatarSmall;
	}
	
	public UserInfo(@NotNull @Min(1) Long id, String account, Integer accountDefault, String mobilephone,
			String nickname, String sex, String email, Integer country, Integer province, Integer city, String company,
			String job, String school, Long birthday, Integer love, String sign, Integer vip, Integer verified,
			Long verifiedTime, Integer celebrity, String avatar, String background, Integer homeCountry,
			Integer homeProvince, Integer homeCity, String device, Integer secret, String facebookOpenId,
			Integer notifyZan, Integer notifyComment, Integer notifyFollow, Integer notifyGroup, Integer notifyVoice,
			List<PhotoInfo> photos, String home,String countryCode, String avatarSmall) {
		super();
		this.id = id;
		this.account = account;
		this.accountDefault = accountDefault;
		this.mobilephone = mobilephone;
		this.nickname = nickname;
		this.sex = sex;
		this.email = email;
		this.country = country;
		this.province = province;
		this.city = city;
		this.company = company;
		this.job = job;
		this.school = school;
		this.birthday = birthday;
		this.love = love;
		this.sign = sign;
		this.vip = vip;
		this.verified = verified;
		this.verifiedTime = verifiedTime;
		this.celebrity = celebrity;
		this.avatar = avatar;
		this.background = background;
		this.homeCountry = homeCountry;
		this.homeProvince = homeProvince;
		this.homeCity = homeCity;
		this.device = device;
		this.secret = secret;
		this.facebookOpenId = facebookOpenId;
		this.notifyZan = notifyZan;
		this.notifyComment = notifyComment;
		this.notifyFollow = notifyFollow;
		this.notifyGroup = notifyGroup;
		this.notifyVoice = notifyVoice;
		this.photos = photos;
		this.secret = secret;
		this.facebookOpenId = facebookOpenId;
		this.notifyZan = notifyZan;
		this.home = home;
		this.countryCode = countryCode;
		this.avatarSmall = avatarSmall;
	}
	public UserInfo() {
		super();
		//  Auto-generated constructor stub
	}
	@Override
	public String toString() {
		return "{"
				+ "userId:" + id 
				+ ",nickname:" + nickname 
				+ ",account:" + account 
				+ "}";
	}
	
	
}
